Skip to content

Stop dev from creating unused default bindings dir#5460

Open
clockwork-labs-bot wants to merge 3 commits into
masterfrom
bot/dev-config-local-fixes
Open

Stop dev from creating unused default bindings dir#5460
clockwork-labs-bot wants to merge 3 commits into
masterfrom
bot/dev-config-local-fixes

Conversation

@clockwork-labs-bot

@clockwork-labs-bot clockwork-labs-bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Description of Changes

Addresses the #3579 report where spacetime dev creates an empty default src/module_bindings directory even though spacetime generate correctly uses the configured generate entries.

spacetime dev now prepares the default --module-bindings-path directory only when it will use CLI-driven generation. If generation is driven by spacetime.json entries, or generation is skipped, dev leaves that default path alone.

This addresses part of #3579, but does not close the broader umbrella issue.

API and ABI breaking changes

None.

Expected complexity level and risk

The change is narrowly scoped to dev's default bindings directory preparation. Config-driven generation behavior is unchanged.

Testing

  • Focused default bindings-dir guard test:
PATH=/Users/clockworklabs/.rustup/toolchains/1.93.0-aarch64-apple-darwin/bin:$PATH \
  cargo test -p spacetimedb-cli test_default_module_bindings_dir_is_only_prepared_for_cli_generation -- --nocapture
  • Focused dev CLI unit tests from the original patch:
PATH=/Users/clockworklabs/.rustup/toolchains/1.93.0-aarch64-apple-darwin/bin:$PATH \
  cargo test -p spacetimedb-cli subcommands::dev::tests:: -- --nocapture
  • CLI crate check from the original patch:
PATH=/Users/clockworklabs/.rustup/toolchains/1.93.0-aarch64-apple-darwin/bin:$PATH \
  cargo check -p spacetimedb-cli
  • cargo fmt --all
  • git diff --check

}

if !module_bindings_dir.exists() {
let should_prepare_module_bindings_dir =

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am rather surprised that we addressed this issue, which is about spacetime generate working properly but not spacetime dev's generate, without re-using code from spacetime generate. shouldn't the fix be to share more of the codepaths so the behavior can't deviate?

@clockwork-labs-bot clockwork-labs-bot changed the title Fix dev local config generation Stop dev from creating unused default bindings dir Jun 29, 2026
}

#[test]
fn test_create_local_spacetime_config_if_missing_upserts_missing_database() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this test removed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants